package org.phoenixframework.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.phoenixframework.common.entity.base.BaseEntity;
import org.phoenixframework.common.entity.validator.FlagValidator;

import javax.validation.constraints.NotBlank;

/**
 * <p>
 * 系统用户表
 * </p>
 *
 * @author doublelife
 * @since 2021-05-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_user")
@ApiModel(value = "SysUser对象", description = "系统用户表")
public class SysUser extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @NotBlank(message = "登录名不能为空字符串")
    @ApiModelProperty(value = "登录名")
    @TableField("username")
    private String username;

    @ApiModelProperty(value = "密码")
    @TableField("password")
    private String password;

    @ApiModelProperty(value = "头像")
    @TableField("avatar")
    private String avatar;

    @ApiModelProperty(value = "是否超级管理员，1/0")
    @TableField("is_super")
    @FlagValidator(value = {"0", "1"}, message = "显示状态不正确")
    private Integer isSuper;

    @ApiModelProperty(value = "部门ID")
    @TableField("dept_id")
    private Long deptId;


}
